Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support empty invert_mask in measument gate deserialization #6224

Merged
merged 9 commits into from
Aug 2, 2023

Conversation

NoureldinYosri
Copy link
Collaborator

@NoureldinYosri NoureldinYosri commented Jul 31, 2023

No description provided.

@NoureldinYosri NoureldinYosri changed the title Restore legacy behaviour Restore legacy behaviour of arg deserializer Jul 31, 2023
@NoureldinYosri NoureldinYosri mentioned this pull request Jul 31, 2023
2 tasks
@CirqBot CirqBot added the size: S 10< lines changed <50 label Jul 31, 2023
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (c510fff) 97.36% compared to head (08c4787) 97.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6224      +/-   ##
==========================================
- Coverage   97.36%   97.35%   -0.01%     
==========================================
  Files        1116     1116              
  Lines       95700    95708       +8     
==========================================
  Hits        93181    93181              
- Misses       2519     2527       +8     
Files Changed Coverage Δ
...le/cirq_google/serialization/circuit_serializer.py 99.45% <100.00%> (+<0.01%) ⬆️
...rq_google/serialization/circuit_serializer_test.py 98.97% <100.00%> (+0.02%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dstrain115
Copy link
Collaborator

Can you explain what legacy behavior this is restoring? I am not sure I understand what got broken.

@NoureldinYosri NoureldinYosri changed the title Restore legacy behaviour of arg deserializer Restore legacy behaviour of arg serialization Aug 1, 2023
@NoureldinYosri
Copy link
Collaborator Author

@dstrain115 An empty list arg is assumed to be a list of boolean

This breaks measurement gate deserialization when the invertion mask is empty because during serialization it's not set. so during deserialization the value becomes None instead of an empty list.

@NoureldinYosri NoureldinYosri changed the title Restore legacy behaviour of arg serialization Support empty invert_mask in measument gate deserialization Aug 1, 2023
arg_function_language=arg_function_language,
required_arg_name=None,
),
invert_mask_ = arg_func_langs.arg_from_proto(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having invert_mask and invert_mask_ is pretty confusing. Can we give one a better name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to parsed_invert_mask

@NoureldinYosri NoureldinYosri merged commit 701538c into master Aug 2, 2023
33 of 35 checks passed
@NoureldinYosri NoureldinYosri deleted the internalgate branch August 2, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants